package day5.date;

import org.junit.Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author joker
 * @date 2022/4/15 0015 - 21:31
 */
public class DateTest {
    @Test
    public void test1() throws ParseException {
//        Date date = new Date();
//        System.out.println(date.toString());
//        System.out.println(date.getTime());
//        System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm").format(new Date())
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date date1 = sdf.parse("1990-01-01");
        Date date2=sdf.parse("2001-10-06");
        int days= (int) ((date2.getTime()-date1.getTime())/(1000*60*60*24));
//        System.out.println(days%5);

        switch (days%5){
            case 0:
                System.out.println("晒网");
                break;
            case 4:
                System.out.println("晒网");
                break;
            case 1:
                System.out.println("打鱼");
                break;
            case 2:
                System.out.println("打鱼");
                break;
            case 3:
                System.out.println("打鱼");
                break;
        }
    }

}
